﻿@model  Kevin.Shop.Business.Core.Member.UserBasicInfo
@{

    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>蓉记·鲜享家</title>
    <link rel="stylesheet" href="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/css/summer.css?v=2">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/css/animate.css">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/css/parallax.css">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/css/parallax-animation.css">
    <script>
        paceOptions = {
            elements: true
        };
    </script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/pace.min.js"></script>
    <script>

        var href = window.location.href;
        function load(time) {
            var x = new XMLHttpRequest()
            x.open('GET', "" + href + "?" + time, true);
            x.send();
        };

        load(20);
        load(100);
        load(500);
        load(2000);
        load(3000);

        setTimeout(function () {
            Pace.ignore(function () {
                load(3100);
            });
        }, 4000);

        Pace.on('hide', function () {
            //
        });

    </script>
</head>
<body>
    <div class="audioPlayer">
        <a href="~/Themes/RongJi/Style/xianxiangcardsubscribe/assets/audio/2.mp3" title="" class="sm2_button"></a>
    </div>
    <div class="poster-wrapper">
        <div class="pages">


            <section class="page pageBg bg1">
                <div class="item_c t1 fadeInDown animated"></div>
            </section>

            @*<section class="page pageBg bg2">
                <div class="item_c t2 fadeInUp animated"></div>
            </section>

            <section class="page pageBg bg3">
                <div class="item_c t3 fadeInRight animated"></div>
            </section>

            <section class="page pageBg bg4">
                <div class="item_c t4 fadeInLeft animated"></div>
            </section>*@

            <section class="page pageBg bg5">
                <div class="item_c t5 zoomIn animated"></div>
                <div class="item_c t51 fadeInUp animated"></div>
            </section>

            <section class="page pageBg bg6">
                <div class="item_c t61 bounceIn animated"></div>
                <div class="item_c t62 fadeInUp animated"></div>
            </section>

            <section class="page pageBg bg7">
                <div class="item_c t7 bounceIn animated"></div>
            </section>

            <section class="page pageBg bg8">
                <div class="item_c t81 fadeInLeft animated"></div>
                <div class="item_c t82 fadeInRight animated"></div>
                <div class="item_c t83 zoomIn animated"></div>
            </section>

            <section class="page pageBg bg9">
                <div class="item_c t91 bounceIn animated"></div>
                <div class="item_c t92 zoomIn animated"></div>
                <div class="item_c t93 fadeInUp animated"></div>
            </section>

            <section class="page pageBg bg9">
                <div class="apply-wrapper">
                    <div class="apply-form">
                        <input type="text" class="input-txt" id="UserName" placeholder="您的姓名">
                        <input type="text" class="input-txt" id="CellPhone" placeholder="您的电话">
                        <div id="element_id">
                            <select id="region" name="region" class="province cxselect" data-value="陕西省" data-first-title="选择省">
                                <option value="" selected="selected">省份</option>
                            </select>
                            <select id="city" name="city" class="city cxselect" data-value="西安市" data-first-title="选择市">
                                <option value="0">城市</option>

                            </select>
                            <select id="county" name="county" class="area cxselect" data-value="未央区" data-first-title="选择地区">
                                <option value="0">区县</option>

                            </select>
                        </div>
                        <input type="text" class="input-txt" id="Address" placeholder="详细地址">
                        <input type="hidden" name="RegionId" id="RegionId">
                        <input type="hidden" name="ThirdUserId" id="ThirdUserId" value="@Model.ThirdUserId">
                        <input type="hidden" name="QQ" id="QQ" value="@Html.Raw("@qq.com")">
                        <button class="submit-btn" id="submit">提交预约</button>
                    </div>
                </div>
            </section>

        </div>
    </div>


    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/zepto.min.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/parallax.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/main.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/jquery.min.js?v=1.10.1"></script>

    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/jquery.cxselect.min.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/soundmanager2-jsmin.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/mp3-player-button.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/pg_common.js"></script>

    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/pg_global.js"></script>
    <script src="~/Themes/RongJi/Style/xianxiangcardsubscribe/dist/js/RegionSelect.js"></script>
    <script>
        //$.cxSelect.defaults.url = 'dist/data/cityData.min.json';
        // $('#element_id').cxSelect({
        //  selects: ['province', 'city', 'area']
        // });
    </script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script type="text/javascript">

        window.config = {
            link: 'http://m.rongji365.com/Customer/XianXiangCardSubscribe',
            imgUrl: 'http://m.rongji365.com/Themes/RongJi/Style/xianxiangcardsubscribe/assets/img/sharelogo.jpg',
            img_url: 'http://m.rongji365.com/Themes/RongJi/Style/xianxiangcardsubscribe/assets/img/sharelogo.jpg',
            title: '蓉记鲜鲜鲜开启招募尊享钻石VIP会员之旅。',
            desc: ' 邀您诚鉴感恩之心，您就是我们的鲜享家！',
        };
        window.timelineconfig = {
            link: 'http://m.rongji365.com/Customer/XianXiangCardSubscribe',
            imgUrl: 'http://m.rongji365.com/Themes/RongJi/Style/xianxiangcardsubscribe/assets/img/sharelogo.jpg',
            img_url: 'http://m.rongji365.com/Themes/RongJi/Style/xianxiangcardsubscribe/assets/img/sharelogo.jpg',
            title: '邀您诚鉴感恩之心，蓉记鲜鲜鲜开启招募尊享钻石VIP会员之旅，您就是我们的鲜享家！',
        };
        function onBridgeReady() {
            WeixinJSBridge.call('showOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }

        document.addEventListener('WeixinJSBridgeReady', function () {
            var WJ = WeixinJSBridge;

            WJ.on('menu:share:appmessage', function () {
                WJ.invoke('sendAppMessage', config, function (res) {
                    // _report('sendAppMessage', res.err_msg);
                });
            });

            WJ.on('menu:share:timeline', function () {
                config.title = config.title + config.desc;
                WJ.invoke('shareTimeline', config, function (res) {
                    // _report('shareTimeline', res.err_msg);
                });
            });


            WJ.on('menu:share:weibo', function () {
                WJ.invoke('shareWeibo', config, function (res) {
                    // _report('shareWeibo', res.err_msg);
                });
            });
        });

        $(function () {
            //得到全部省
            $.ajax({
                type: "GET",
                dataType: "JSON ",
                url: "/MyAccount/RegionList?parentId=0",
                success: function (response) {
                    var $region = $("#region");
                    for (var i = 0, len = response.length; i < len; i++) {
                        $region.append($("<option value='" + response[i].RegionId + "'>" + response[i].RegionName + "</option>"));
                    }
                },
                error: function (err) {
                    //alert(err.responseText);
                }
            });



            var date = new Date();
            var year = date.getFullYear();
            var month = date.getMonth() + 1;
            var day = date.getDate();
            var hour = date.getHours();
            var minute = date.getMinutes();
            var second = date.getSeconds();
            var haomiao = date.getTime();
            var str = year.toString() + month.toString() + day.toString() + hour.toString() + minute.toString() + second.toString() + haomiao.toString();

            //submit
            $("#submit").click(function () {
                var userName = $.trim($("#UserName").val());
                var cellPhone = $.trim($("#CellPhone").val());
                var regionId = $("#RegionId").val();
                var address = $.trim($("#Address").val());
                var thirdUserId = $.trim($("#ThirdUserId").val());
                var qq = $.trim($("#QQ").val());

                //alert(qq);
                //alert(thirdUserId);

                if (thirdUserId == "") {
                    alert('不是微信用户');
                    return false;
                }

                if (userName == "") {
                    alert('请输入姓名');
                    return false;
                }
                if (cellPhone == "") {
                    alert('请输入手机号码');
                    return false;
                }

                reg = /^(\+\d{2,3}\-)?\d{11}$/;
                if (!reg.test(cellPhone)) {
                    alert('请输入正确的手机号码');
                    return false;
                }

                if (regionId == "") {
                    alert('请选择地区');
                    return false;
                }

                if (address == "") {
                    alert('请输入地址');
                    return false;
                }

                var userName = $.trim($("#UserName").val());
                var cellPhone = $.trim($("#CellPhone").val());
                var regionId = $("#RegionId").val();
                var address = $.trim($("#Address").val());
                var submitData = {
                    UserName: "weixing_" + str,
                    RealName: userName,
                    CellPhone: cellPhone,
                    RegionId: regionId,
                    Address: address,
                    Email: "weixing_" + str + qq,
                    ThirdUserId: thirdUserId
                };


                $.ajax({
                    type: "POST",
                    data: submitData,
                    dataType: "JSON",
                    url: "/Customer/RegisterXianXiangByAjaxRequest",
                    success: function (response) {
                        if (response != null && response.Status && response.Operate == 'create') {
                            alert("预约成功，我们已经记录您的信息，稍后会有鲜享家生活管家联系您。");
                            window.location.href = '/Customer/XianXiangCardSelect'

                            return;
                        }
                        else if (response != null && response.Status && response.Operate == 'update') {
                            alert("预约成功，我们已经记录您的信息，稍后会有鲜享家生活管家联系您。");
                            window.location.href = '/Customer/XianXiangCardSelect'

                            return;
                        }
                        else if (response != null && response.Status == false && response.ErrorMessage != null) {
                            alert(response.ErrorMessage);

                            return false;
                        }
                    },
                    error: function (err) {
                        //alert(err.responseText);

                        return false;
                    }
                });
            });

            var postData = {
                "currentUrl": location.href.split('#')[0]
            }
            $.post("/WeixinJsSdk/ConfigScriptJson", postData, function (wxConfig) {
                //wxConfig=   JSON.parse(wxConfig);
                //wxConfig.debug = true;
                wxConfig.jsApiList.push("showOptionMenu");
                wx.config(wxConfig);

                wx.ready(function () {

                    var config = window.config;
                    wx.onMenuShareAppMessage(config);
                    wx.onMenuShareTimeline(window.timelineconfig);
                    wx.onMenuShareQQ(config);
                    wx.onMenuShareWeibo(config);

                    wx.showOptionMenu();
                });

                wx.error(function (res) {

                });
            });
        });
    </script>
    <!--Static Code Start-->
    <img src="http://img.tongji.linezing.com/3547905/tongji.gif" style="display:none;">
    <script type="text/javascript">
        var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
        document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd2c430d3acdc174f29f6feef73ea35fa' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <!-- Piwik -->
    <script type="text/javascript">
        var _paq = _paq || [];
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function () {
            var u = "//analytics.it-hsmedia.com/";
            _paq.push(['setTrackerUrl', u + 'piwik.php']);
            _paq.push(['setSiteId', 2]);
            var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
            g.type = 'text/javascript'; g.async = true; g.defer = true; g.src = u + 'piwik.js'; s.parentNode.insertBefore(g, s);
        })();
    </script>
    <noscript><p><img src="//analytics.it-hsmedia.com/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
    <!-- End Piwik Code -->
    <!--Static Code End-->
</body>
</html>